package org.zjblague.blog.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.zjblague.blog.dao.TagDAO;
import org.zjblague.blog.model.Tag;

@Controller
public class LoginController {
	
	private static final Logger LOG = LoggerFactory.getLogger(LoginController.class);
	
	
	@Autowired
	TagDAO tagDao ;
	
	public TagDAO getTagDao() {
		return tagDao;
	}

	public void setTagDao(TagDAO tagDao) {
		this.tagDao = tagDao;
	}

	@RequestMapping(value="/admin/index")
	public String welcome(){
		return "home";
	}
	
	@RequestMapping(value="/")
	public String test(){
		LOG.info("enter LoginController");
		Tag tag = new Tag();
		tag.setName("Test");
		tagDao.save(tag);
		return "home";
	}
}
